public class StringParsing {
    public static void main(String[] args) {
        String input = "no pains, no gains.";
        
        // 使用空格和逗号作为分隔符，将字符串解析成单词数组
        String[] words = input.split("[,\\s]+");
        
        for (String word : words) {
            System.out.println(word);
        }
    }
}
